多参考图生视频
根据多参考图片生成视频,图像引用数组(1–3项),仅支持异步模式。调用该接口前,您需要先通过调用「上传文件」接口获取输入的原图路径;调用该接口后,您可通过调用「查询任务生成结果」接口获取视频的生成结果。
POST
https://cloud.baicaiinfer.com/v1/videos/generations
Authorizations
Body
application/json
input:ObjectRequired
输入参数集合。
input.prompt:StringRequired
是生成视频时用于描述期望内容(如场景、风格、细节等)的正向提示词。prompt引用的名称必须与mutil_reference中的name参数完全一致。
input.negative_prompt:String
用于指定生成视频时需避免的元素(如低质量、失真等)的反向提示词,以优化生成结果的质量。
input.resolution:StringRequired
分辨率(取值:360p、540p、720p、1080p)。
input.aspect_ratio:String
无需指定,以输入的首张图的宽高比输出。
input.duration:IntRequired
视频时常(取值:5、8),单位s,若指定分辨率为1080p时只支持输出5s的视频。
input.mutil_reference:Array<Object>Required
图像引用数组(1–3项),包含“主体”或“背景”。
input.mutil_reference.type:StringRequired
支持的类型(取值:subject、background)。
input.mutil_reference.name:StringRequired
类型名称,必须在数组中唯一。
input.mutil_reference.urls:Array<String>Required
对应的图片url,每个主体最多支持3张图片。
input.number_of_videos:Int
指定生成视频的数量,取值范围为1~4。默认值:1。
need_expand_prompt:Boolean
优化提示词(取值:true、false),默认值:false。
async:Boolean
采用异步方式处理请求,默认值:true。
Response
状态码:application/json
200
code:IntRequired
表示请求处理状态的状态码。
0
400
500
0是成功标识,表示接口正常返回预期结果。
message:StringRequired
返回请求的处理结果,通常配合状态码使用,直观告知用户当前请求的具体情况。
data:objectRequired
任务的核心结果数据。
data.taskId:StringRequired
任务的唯一标识ID。
ts:StringRequired
响应的时间戳。
cURL
Python
JavaScript
curl --location --request POST 'https://cloud.baicaiinfer.com/v1/videos/generations' \
--header 'Authorization: Bearer sk-VStOhW7gwGTcy5lFuDg*****' \
--header 'Content-Type: application/json' \
--data-raw '{
"selected_model": "PixVerse-v4.5-MR2V",
"task_type": "multi_ref_img2video",
"input": {
"prompt": "@human and @dog paly on the @grass",
"resolution": "720p",
"duration": 5,
"mutil_reference": [
{
"type": "subject",
"name": "human",
"urls": ["https://s1.llamafactory.online/baicai-infer/users/7e4113a5a1284465831eaefaa0022a98/12.png"]
},
{
"type": "subject",
"name": "dog",
"urls": ["https://s1.llamafactory.online/baicai-infer/users/7e4113a5a1284465831eaefaa0022a98/13.png"]
},
{
"type": "background",
"name": "grass",
"urls": ["https://s1.llamafactory.online/baicai-infer/users/7e4113a5a1284465831eaefaa0022a98/11.png"]
}
]
}
}'
200
400
401
404
500
{
"code": 0,
"message": "任务提交成功",
"data": {
"taskId": "3524e0b3ba014b12ab1faf29f9f*****"
},
"ts": "2026-03-09T10:44:54.716004004+08:00[Asia/Shanghai]"
}